package com.example.a2306_fx.adapter

import android.widget.CheckBox
import com.bumptech.glide.Glide
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.example.a2306_fx.R
import com.example.base.entity.Cart

class CartAdapter:BaseQuickAdapter<Cart,BaseViewHolder>(R.layout.item_cart) {
    override fun convert(holder: BaseViewHolder, item: Cart) {
        holder.getView<CheckBox>(R.id.cart_cb).isChecked = item.isChecked
        Glide.with(context).load(item.image).into(holder.getView(R.id.cart_image))
        holder.setText(R.id.cart_storename,item.storeName)
        holder.setText(R.id.cart_price,"￥${item.price}")
        holder.setText(R.id.cart_num,item.cartNum.toString())
    }
}